<?php

/**
 * Description of SpecialDateForm
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 */

class SpecialDateForm extends sfForm {
    
    public function configure() {
        $this->setWidgets(array(
            'date' => new sfWidgetFormInput(),
            'description' => new sfWidgetFormInput(),
            'all_restaurants' => new sfWidgetFormInputCheckbox(array('value_attribute_value' => 1))
        ));

        $this->setValidators(array(
            'date' => new sfValidatorDate(array('required' => true)),
            'description' => new sfValidatorString(array('max_length' => 50, 'min_length' => 3, 'required' => true)),
            'all_restaurants' => new sfValidatorInteger(array('min' => 1, 'max' => 1, 'required' => false))
        ));

        $this->widgetSchema->setNameFormat('special_date[%s]');
    }
}
